﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">
    <title>${setting.siteName} - 药品表详情</title>
    <meta name="keywords" content="${setting.siteName}">
    <meta name="description" content="${setting.siteName}">
    <!-- BEGIN HEADER -->
[#include "/admin/include/style.ftl"]
    <!-- END HEADER -->
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content  animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>药品表详情</h5>
                    <div class="ibox-tools">
                        <button type="button" class="btn btn-outline btn-white btn-xs" id="btn-return-loippi"
                                onclick="location.href='${base}/admin/medicine/list.jhtml'"><i
                                class="fa fa-reply-all"></i> 返回列表
                        </button>
                    </div>
                </div>
                <div class="ibox-content">
                    <form id="inputForm" class="form-horizontal" action="update.jhtml" method="post">
                        <input type="hidden" value="${tMedicine.id}"
                               name="id"/>

                                <div class="form-group">
                                    <div class="row">
                                      <div class="col-sm-6">
                                          <label class="col-sm-3 control-label">
                                              药品名称</label>
                                          <div class="col-sm-9">
                                              <p class="form-control-static">${(tMedicine.name)!''}</p>
                                          </div>
                                      </div>
                                      <div class="col-sm-6">
                                        <label class="col-sm-3 control-label">药品名称首字母</label>
                                        <div class="col-sm-9">
                                          <p class="form-control-static">${(tMedicine.medicineLetters)!''}</p>
                                        </div>
                                      </div>
                                    </div>
                                </div>
                            <!--/row-->
                                <div class="form-group">
                                    <div class="row">
                                        <div class="col-sm-6">
                                            <label class="col-sm-3 control-label">售卖状态</label>
                                            <div class="col-sm-9">
                                              <p class="form-control-static">${(((tMedicine.status)!'')==1)?string('上架', '下架')}</p>
                                            </div>
                                        </div>
                                       <div class="col-sm-6">
                                        <label class="col-sm-3 control-label">
                                            分类名称</label>
                                        <div class="col-sm-9">
                                            <p class="form-control-static">${(tMedicine.stairName)!''}</p>
                                        </div>
                                      </div>
                                    </div>
                                </div>
                            <!--/row-->
                                <div class="form-group">
                                    <div class="row">
                                      <div class="col-sm-6">
                                          <label class="col-sm-3 control-label">
                                              库存</label>
                                          <div class="col-sm-9">
                                              <p class="form-control-static">${(tMedicine.repertory)!''}</p>
                                          </div>
                                      </div>
                                       <div class="col-sm-6">
                                          <label class="col-sm-3 control-label">已售</label>
                                          <div class="col-sm-9">
                                            <p class="form-control-static">${(tMedicine.sellcount)!''}</p>
                                          </div>
                                      </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <div class="row">
                                      <div class="col-sm-6">
                                          <label class="col-sm-3 control-label">药品价格</label>
                                          <div class="col-sm-9">
                                            <p class="form-control-static">${(tMedicine.price)!''}</p>
                                          </div>
                                      </div>
                                      <div class="col-sm-6">
                                        <label class="col-sm-3 control-label">划线价格</label>
                                        <div class="col-sm-9">
                                            <p class="form-control-static">${(tMedicine.linePrice)!''}</p>
                                        </div>
                                    </div>

                                    </div>
                                </div>
                            <!--/row-->
                                <div class="form-group">
                                    <div class="row">
                                      <div class="col-sm-6">
                                          <label class="col-sm-3 control-label">
                                              图文详情</label>
                                          <div class="col-sm-9">
                                              <textarea id="editor" name="productDetails" class="editor">${(tMedicine.productDetails)!''}</textarea>
                                          </div>
                                      </div>
	                                    <div class="col-sm-6">
                                          <label class="col-sm-3 control-label">药品缩略图</label>
                                          <div class="col-sm-9">
                                            <img src="${(tMedicine.thumbnailPic)!''}" style="width:100px;height:100px"/>
                                          </div>
                                        </div>

                                    </div>
                                </div>
                                <div class="form-group">
                                    <div class="row">
                                        <div class="col-sm-12">
                                            <label class="col-sm-3 control-label">药品轮播图片<p style="color: red">
                                                    (宽500*高500像素，大小在120KB以内，最多5张，要求JPG或GIF格式)</p></label>
                                            <input type="hidden" name="images" id="images">
                                            <div class="col-sm-9" id="pictureList">
                                            </div>
                                            [#-- <div class="col-sm-9" id="previewImages"></div>--]
                                        </div>
                                    </div>
                                </div>

                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <div class="col-sm-12 col-sm-offset-10">
                                <button type="button" class="btn btn-default" onclick="window.history.back();">返回
                                </button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- BEGIN Script -->
[#include "/admin/include/script.ftl"]
<!-- END Script -->
<script>
    /*多图片*/
    var picList = $("#pictureList").zupImg({
        "targetId": "images",
        "maxFileSize": 10,
        "preview": false,
        "mul": true
    });

    //加载多图片
    function loadImgs() {
        var imgStrs = "${tMedicine.picList}";
        if (imgStrs != '') {
            var arr = imgStrs.split(',');
            for (var i in arr) {
                if(arr[i].startsWith("[")){
                    arr[i]=arr[i].substring(1);
                }
                if(arr[i].endWith("]")){
                    arr[i]=arr[i].substr(0,arr[i].length-1);
                }
                picList.addImg(arr[i]);
            }
        }
    }

    $(document).ready(function () {
        loadImgs();
    });

    String.prototype.endWith=function(oString){
        var   reg=new   RegExp(oString+"$");
        return   reg.test(this);
    }
</script>
</body>
</html>
